<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="<%=path %>/styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path %>/js/main.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.form.js"></script>
</head>
<body>
<form id="typeForm" name="typeForm"  method="post" action="<%=path %>/km/type/save.do"> 
	<div id="DetailContent">	
		<table width="100%" border="0" cellspacing="2" cellpadding="2"  class="TableForm" height="120">
		  <tr>
			<td  nowrap="nowrap" width="80">分类名称：</td>
			 <td class="NTbsM">
			 	<input name="typeId" type="hidden" value="<s:property value="kmType.typeId"/>"/>
			 	<input name="typePid" type="hidden" value="<s:property value="kmType.typePid"/>"/>
			 	<input name="typeName" type="text"  value="<s:property value="kmType.typeName"/>" class="InputText" onfocus="this.className='InputTextDown'" onblur="this.className='InputText'" />
			 </td>
		  </tr>
		</table>	
	</div>  
	<!--工具按钮-->
	<div  id="FormToobar" style="margin:0 5px; border: solid 1px #6d6d6d;">
		<div id="MsgDiv" style="float:left"></div>
		<div style="float:right">
		    <tt><input name="btnSave" type="button" class="But" value="保存" onclick="save()"/> </tt>
		    <tt><input name="btnReturn" type="button" class="But" value="返回" onclick="parent.ymPrompt.close();" /></tt>
	    </div>	
	</div>
</form>
<script type="text/javascript">
	function save(){
	    var form = $("form[name=typeForm]"); 
        var options = {success:showResponse,resetForm:false,dataType:'script'};
        form.ajaxSubmit(options);       
        return;   
	}
	function showResponse(data){//回调函数
	    if('add' == data ){
	    	document.getElementById("MsgDiv").innerHTML="保存成功！";
	    	parent.refreshTree('add');	     
	    }else if('update'==data){
	    	document.getElementById("MsgDiv").innerHTML="保存成功！";
	    	parent.refreshTree('update');
	    }else{
	        document.getElementById("MsgDiv").innerHTMNL="操作失败";
	    }
	}
</script>
</body>
</html>
